﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master1.Master" AutoEventWireup="true" CodeBehind="OrderInformation.aspx.cs"
    Inherits="TienTeTuong.OrderInformation" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <link href="css/Order.css" rel="stylesheet" type="text/css" />
    <div>
        <div class="mainTitle">
            Giỏ Hàng</div>
        <div class="mainBrowse">
            Trở về: <a href="Home.aspx">Trang chủ</a>
        </div>
        <div class="Content mainProduct">
            <table cellspacing="0" id = "tblOrder">
                <thead>
                    <tr>
                        <th>
                            Gói sản phẩm
                        </th>
                        <th>
                            Số lượng
                        </th>
                        <th>
                            Đơn giá
                        </th>
                        <th>
                            Thành tiền
                        </th>
                        <th width = " 20px">
                        </th>
                        <th width = " 20px">
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <% foreach (var item in CurOrder.Items)
                       { %>
                     <tr id="<%=item.CategoryDetailID %>">
                        <td>
                            <span class="CategoryName">
                                <%=item.NameToDisplay %>:</span>
                            <% foreach (var product in item.Products)
                               {%>
                            <%= product.ProName %> (<%=product.Quantity %><%=product.unit %>)<%if(product.ProId.Equals(item.Products[item.Products.Count-1].ProId)){ %>.
                            <%} else { %>,
                            <%}
                              } %>
                        </td>
                        <td style='text-align: center; width: 60px'>
                            <input type = "text" class = "Quantity" value = "<%=item.CategoryQuantity %>"/>
                        </td>
                        <td style='text-align: right; width: 60px'>
                            <span class = "Price"><%=item.Price %></span>
                        </td>
                        <td style='text-align: right;width: 100px'>
                            <span class = "PriceSum"><%=item.Price * item.CategoryQuantity%></span>
                        </td>
                        <td class = "tdclick">
                            <span class="btnRemoveFromOrder">Xóa</span>
                        </td>
                        <td class = "tdclick">
                             <a href = "productDetail.aspx?action=Edit&CateDetailID=<%=item.CategoryDetailID %>" style = "text-decoration: none; color: Black">Sửa</a>
                        </td>
                    </tr>
                    <%} %>
                    <tr style="background-color: #4b2e27; color: white; font-weight: bold;">
                        <td>Tổng cộng:</td>
                        <td></td>
                        <td></td>
                        <td style="text-align: right"><span id = "Total">0</span> VNĐ</td>
                        <td></td>
                        <td></td>
                    </tr>
                </tbody>
            </table>
            <asp:Button ID="btnSave" CssClass="btnCartBgss" runat="server" Text="Lưu thay đổi và tiếp tục đặt hàng" OnClick="btnSave_Click" style="width: 290px; background: url(images/btnUpdateOrder.png) left repeat-x"></asp:Button>
            <div class="Titlep">Thông tin thanh toán</div>
            <ul id="PaymentForm">
                 <li>Xin vui lòng điền đầy đủ các thông tin có dấu (*) </li>
                <li>Họ và tên (*):<asp:TextBox type="text" ID="ReceiverName"  runat="server"/></li>
                <li>Điện thoại(*):<asp:TextBox type="text" ID="PhoneNumber" runat="server"/></li>
                <li>E-mail(*):<asp:TextBox type="text" ID="Email" runat="server" /></li>
                <li>Địa chỉ(*):<asp:TextBox type="text" ID="Address"  runat="server"/></li>
                <li>Ghi chú:<textarea></textarea></li> 
               
                <li> <asp:Button runat="server" CssClass="btnCartBgss" Text="Thanh toán" ID="btnCheckOut" onclick="btnCheckOut_Click"/></li>
            </ul>
            <asp:HiddenField runat="server" ID="arrRemovedItem" />
            <asp:HiddenField runat="server" ID="Note" />
            <asp:HiddenField runat="server" ID="QuantityUpdateID" />
            <asp:HiddenField runat="server" ID="QuantityUpdateNum" />
            <script language="javascript" type="text/javascript">
                var arrProductID = $('#' + '<%=arrRemovedItem.ClientID %>');
                var Note = $('#' + '<%=Note.ClientID %>');
                var QuantityID = $('#' + '<%=QuantityUpdateID.ClientID %>');
                var QuantityNum = $('#' + '<%=QuantityUpdateNum.ClientID %>');
                var btnCheckOut = $('#' + '<%=btnCheckOut.ClientID %>');
            </script>
            <script type="text/javascript" language="javascript" src="js/Order.js"></script>
        </div>
    </div>
</asp:Content>
